The present invention generally relates to an automated program-generating apparatus which has transformation rules describing the relationship between the input specification and the output program internally, and generates the program from the input specification according to the transformation rules, and more particularly to an automated program-generating apparatus in which part of the transformation rules are separated as external information, and metarules dynamically switch transformation modes by accessing the information.